/* 
 * File:   ConnTcpip.h
 * Author: kisme
 *
 * Created on 26 December 2012, 10:27 PM
 */

#ifndef CONNTCPIP_H
#define	CONNTCPIP_H

#include "ConnBase.h"

struct Conf_ConnTcpip : public Conf_ConnBase
{
    // listen port
    int port;
    // socket buffer length
    int queue;
    // fd
    int fd;
    //
    struct sockaddr_in *addr_in;
    //
    socklen_t len;
};

class ConnTcpip : public ConnBase {
public:
    
    ConnTcpip();
    ConnTcpip(const ConnTcpip& orig);
    virtual ~ConnTcpip();
    // configure self
    int config();
    // bind port
    int bindPort();
    // listen port
    int listenPort();
    // set nonblock
    int nonBlock();
    // return the socket fd
    int getSockFd();
    


private:
    struct Conf_ConnTcpip *mConf;
};

#endif	/* CONNTCPIP_H */

